<?php
trait A {
    public function smallTalk() {
        echo 'a'  . "</br>\n";
    }
    public function bigTalk() {
        echo 'A'  . "</br>\n";
    }

    public function __construct() {
        echo 'A construct()'  . "</br>\n";
    }

}

trait B {
    public function smallTalk() {
        echo 'b'  . "</br>\n";
    }
    public function bigTalk() {
        echo 'B'  . "</br>\n";
    }

    public function __construct() {
        echo 'B construct()'  . "</br>\n";
    }
}

/*class Talker {
    use A, B {
        B::smallTalk insteadof A;
        A::bigTalk insteadof B;
    }
}*/

class Aliased_Talker {
    use A, B {
        B::smallTalk insteadof A;
        A::bigTalk insteadof B;
        B::bigTalk as talk;
        A::__construct as Ainit;
        B::__construct as Binit;
    }

    public function __construct() {
        echo __CLASS__ . ' construct()' . "</br>\n";
        $this->Ainit();
        $this->Binit();
    }

    public function __destruct() {
        echo __CLASS__ . ' destruct()'  . "</br>\n";
    }

}

$a = new Aliased_Talker();
$a->smallTalk();
$a->bigTalk();
$a->talk();